/**
* @Description: WoShop商城
* @Author: 梧桐
* @Copyright: 武汉一一零七科技有限公司©版权所有
* @Link: www.wo-shop.net
* @Contact: QQ:2487937004
*/
<template>
	<view class="index_class">
		<view class="myrecord" hover-class="click-active-bgc" v-for="(item,index) in recordList" :key="index">
			<view class="color">￥{{item.price}}</view>
			<!-- <view class="">{{999}}</view> -->
            <view>
                <view class="title" >{{item.zc_type_text}}</view>
                <view>{{$u.timeFormat(item.time, 'yyyy-mm-dd hh:MM')}}</view>
            </view>
        </view>
		<u-empty v-if="recordList.length===0" :src="STATICURL+'images/nullStatus/noList.png'" margin-top="200" icon-size="300"
			:text="$t('暂无数据')"></u-empty>
		<loadMore :loadingType="loadingType"></loadMore>
	</view>
</template>

<script>
	let page = 1
	export default {
		onLoad() {
			page = 1
			this.getRechargeList()
		},
		data() {
			return {
				recordList: [],
				loadingType: 0
			}
		},
		onReachBottom: function() {
			// 上拉加载更多
			if (this.loadingType == 1 || this.loadingType == 2) {
				return false
			}
			this.loadingType = 1

			page++
			this.getRechargeList()
		},
		methods: {
			getRechargeList() {
				this.$http.getRechargeList({
					page: page,
					type: 2,
				}).then(res => {
					if (res.status == 200) {
						if (res.data.length == 0) {
							this.loadingType = 2
						}
						this.recordList = [...this.recordList, ...res.data]
						this.loadingType = 0
					}
				})
			}
		},
	}
</script>

<style>

</style>
